class RecommendCardResult {
  bool flag = true;
  int code = 20000;
  String message = "成功";
  List<RecommendCard> data = [];

  RecommendCardResult({required this.flag, required this.code, required this.message, required this.data});

  RecommendCardResult.fromJson(Map<String, dynamic> json) {
    flag = json['flag'];
    code = json['code'];
    message = json['message'];
    if (json['data'] != null) {
      data = <RecommendCard>[];
      json['data'].forEach((v) {
        data.add(new RecommendCard.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['flag'] = this.flag;
    data['code'] = this.code;
    data['message'] = this.message;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class RecommendCard {
  int id = 0;
  String articleCover = '';
  String articleTitle= '';
  String articleContent= '';
  String createTime= '';
  int isTop = 0;
  int type = 0;
  int categoryId = 0;
  String categoryName= '';
  List<TagDTOList> tagDTOList = [];

  RecommendCard(
      {required this.id,
        required this.articleCover,
        required this.articleTitle,
        required this.articleContent,
        required this.createTime,
        required this.isTop,
        required this.type,
        required this.categoryId,
        required this.categoryName,
        required this.tagDTOList});

  RecommendCard.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    articleCover = json['articleCover'];
    articleTitle = json['articleTitle'];
    articleContent = json['articleContent'];
    createTime = json['createTime'];
    isTop = json['isTop'];
    type = json['type'];
    categoryId = json['categoryId'];
    categoryName = json['categoryName'];
    if (json['tagDTOList'] != null) {
      tagDTOList = <TagDTOList>[];
      json['tagDTOList'].forEach((v) {
        tagDTOList.add(new TagDTOList.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['articleCover'] = this.articleCover;
    data['articleTitle'] = this.articleTitle;
    data['articleContent'] = this.articleContent;
    data['createTime'] = this.createTime;
    data['isTop'] = this.isTop;
    data['type'] = this.type;
    data['categoryId'] = this.categoryId;
    data['categoryName'] = this.categoryName;
    if (this.tagDTOList != null) {
      data['tagDTOList'] = this.tagDTOList.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class TagDTOList {
  int id = 0;
  String tagName = '';

  TagDTOList({required this.id,required  this.tagName});

  TagDTOList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    tagName = json['tagName'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['tagName'] = this.tagName;
    return data;
  }
}